﻿using System;

using System.Collections.Generic;
using System.Text;
using Silvermoon.Images;
using System.Drawing;
using Silvermoon.Controls.Base;

namespace Silvermoon.Controls.Sys
{
    public class TextboxToolbar : Toolbar
    {
        public TextboxBase TextBox { get; set; }

        public TextboxToolbar()
            : base()
        {
            CreateButton().Content = SysImages.Paste;
            CreateButton().Content = SysImages.Select;
            CreateButton().Content = "all";

            Buttons[0].Tap += (s, e) => TextboxBase.FocusedTextbox.Paste();
            Buttons[1].Tap += (s, e) =>
            {
                if (TextboxBase.FocusedTextbox != null) TextboxBase.FocusedTextbox.SelectWord();
            };
            Buttons[2].Tap += (s, e) =>
            {
                if (TextboxBase.FocusedTextbox != null) TextboxBase.FocusedTextbox.SelectAll();
            };
        }
    }
}

